package com.gjb6.master.app.storagemanager;

import android.content.Context;

import com.pachong.android.frameworkbase.utils.io.SharePreferenceUtil;

/**
 * SharePreference Dao
 *
 * @Author: PV
 * @E-mail: pengveivei@sina.cn
 * @CreateDate: 2016/7/7 16:49
 * @Version: 1.0.0
 */
public class SpDao {


    private static final String SP_FILENAME_COMMON = "sp_common";
    //第一次启动app
    private static final String KEY_FIRST_TIME_START_APP = "key_first_start_app";
    private static final String KEY_LOGIN = "key_login";

    public static boolean isFirstTimeStartApp(Context context) {
        return SharePreferenceUtil.getBoolean(context, SP_FILENAME_COMMON, KEY_FIRST_TIME_START_APP, true);
    }


    public static void setKeyFirstTimeStartApp(Context context, boolean isFirstTime) {
        SharePreferenceUtil.saveBoolean(context, SP_FILENAME_COMMON, KEY_FIRST_TIME_START_APP, isFirstTime);
    }

    private static final String KEY_WEB_URL = "file:///android_asset/www/index.html";

    public static String getWebCacheUrl(Context context) {
        return SharePreferenceUtil.getString(context, SP_FILENAME_COMMON, KEY_WEB_URL);
    }


    public static void setWebCacheUrl(Context context, String url) {
        SharePreferenceUtil.saveString(context, SP_FILENAME_COMMON, KEY_WEB_URL, url);
    }


}
